package com.mobor.moborsvr.obj.category.factory.impl;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.hibernate.SessionFactory;

import com.mobor.moborsvr.obj.category.dao.CategoryObjectDao;
import com.mobor.moborsvr.obj.category.dao.impl.CategoryObjectDaoImpl;
import com.mobor.moborsvr.obj.category.factory.CategorySearchWorkerFactory;

/**
 * Implements {@link CategorySearchWorkerFactory} interface.
 * @author teroleg
 *
 */
public class CategorySearchWorkerFactoryImpl implements CategorySearchWorkerFactory {
	
	private static final Logger logger = LogManager.getLogger(CategorySearchWorkerFactoryImpl.class.getName());

	@Override
	synchronized public CategoryObjectDao getCategoryObjectDao(SessionFactory sessionFactory) {
		CategoryObjectDao cod =  new CategoryObjectDaoImpl();
		cod.setSessionFactory(sessionFactory);
		
		logger.debug("CategoryObjectDao created");
		
		return cod;
	}
}
